# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openimagedenoise
pkgver=2.2.2
pkgrel=0
pkgdesc="Intel Open Image Denoise library"
url="https://www.openimagedenoise.org/"
arch="aarch64 x86_64" # openimagedenoise only really supports these
license="Apache-2.0"
makedepends="cmake python3 onetbb-dev ispc samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenImageDenoise/oidn/releases/download/v$pkgver/oidn-$pkgver.src.tar.gz"
builddir="$srcdir/oidn-$pkgver"
options="!check" # doesn't have a test suite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_RPATH=ON \
		-DOIDN_APPS=OFF

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
eca18e9e22a40bc1381e75985e5f5e79f48cc6d168a2a703e54540967646487d347db290459e9a612d8ab4924e8d3c83d84664fd5318cca4f17745da1e47cf50  openimagedenoise-2.2.2.tar.gz
"
